import 'package:dio/dio.dart';
import 'package:retrofit/retrofit.dart';
import 'package:sonora/config/sj_config.dart';
import 'package:sonora/models/sj_add_friend_body.dart';
import 'package:sonora/models/sj_broad_caster_response_data.dart';
import 'package:sonora/models/sj_call_create_body.dart';
import 'package:sonora/models/sj_content_search_body.dart';
import 'package:sonora/models/sj_friend_list_body.dart';
import 'package:sonora/models/sj_good_search_body.dart';
import 'package:sonora/models/sj_insert_record_body.dart';
import 'package:sonora/models/sj_login_response_data.dart';
import 'package:sonora/models/sj_media_search_body.dart';
import 'package:sonora/models/sj_media_search_item_data.dart';
import 'package:sonora/models/sj_recharge_create_body.dart';
import 'package:sonora/models/sj_recharge_payment_body.dart';
import 'package:sonora/models/sj_remove_block_body.dart';
import 'package:sonora/models/sj_response_data.dart';
import 'package:sonora/models/sj_review_consume_body.dart';
import 'package:sonora/models/sj_save_userInfo_body.dart';
import 'package:sonora/models/sj_un_friend_body.dart';
import 'package:sonora/models/sj_update_avatar_body.dart';
import 'package:sonora/models/sj_valid_token_body.dart';
import 'package:sonora/models/sj_wall_search_body.dart';
import 'package:sonora/services/sj_api_paths.dart';

part 'sj_api_client.g.dart';

@RestApi(baseUrl: httpHost)
abstract class SjApiClient {
  factory SjApiClient(Dio dio, {String baseUrl}) = _SjApiClient;

  @GET(SjApiPaths.getAppConfig)
  Future<SjResponseData> getAppConfig(@Query("ver") String ver);

  @POST(SjApiPaths.globalLogin)
  @FormUrlEncoded()
  Future<SjLoginResponseData> appleLogin(
      @Field('oauthType') int oauthType, @Field('token') String token);

  @POST(SjApiPaths.getWallSearch)
  Future<SjBroadCasterResponseData> getWallSearch(
      @Body() SjWallSearchBody wallSearchBody);

  @POST(SjApiPaths.checkToken)
  Future<SjResponseData> validToken(@Body() SjValidTokenBody validTokenBody);

  @GET(SjApiPaths.getUserInfo)
  Future<SjResponseData> getUserInfo(@Query("userId") String userId);

  @POST(SjApiPaths.saveUserInfo)
  Future<SjResponseData> saveUserInfo(
      @Body() SjSaveUserInfoBody saveUserInfoBody);

  @GET(SjApiPaths.ossAuthUrl)
  Future<SjResponseData> getOssPolicy();

  @GET(SjApiPaths.getStrategy)
  Future<SjResponseData> getStrategy();

  @GET(SjApiPaths.getRongcloudToken)
  Future<SjResponseData> getRongcloudToken();

  @POST(SjApiPaths.updateAvatar)
  Future<SjResponseData> updateAvatar(
      @Body() SjUpdateAvatarBody updateAvatarBody);

  @POST(SjApiPaths.addFriendUrl)
  Future<SjResponseData> addFriend(@Body() SjAddFriendBody addFriendBody);

  @POST(SjApiPaths.unfriendUrl)
  Future<SjResponseData> unfriend(@Body() SjUnFriendBody unFriendBody);

  @POST(SjApiPaths.complainInsertRecord)
  Future<SjResponseData> insertRecord(
      @Body() SjInsertRecordBody insertRecordBody);

  @POST(SjApiPaths.complainRemoveBlock)
  Future<SjResponseData> removeBlock(@Body() SjRemoveBlockBody removeBlockBody);

  @POST(SjApiPaths.complainBlockList)
  Future<SjResponseData> blockList();

  @POST(SjApiPaths.getFriendsListPage)
  Future<SjResponseData> frientList(@Body() SjFriendListBody friendListBody);

  @GET(SjApiPaths.getUserCoins)
  Future<SjResponseData> getUserCoins();

  @POST(SjApiPaths.goodsSearchUrl)
  Future<SjResponseData> goodsSearch(@Body() SjGoodSearchBody goodSearchBody);

  @POST(SjApiPaths.getContentSearch)
  Future<SjResponseData> getContentSearch(
      @Body() SjContentSearchBody contentSearchBody);

  @POST(SjApiPaths.videoCallMatch)
  Future<SjResponseData> videoCallMatch();

  @POST(SjApiPaths.videoCallCreate)
  Future<SjResponseData> videoCallCreate(
      @Body() SjCallCreateBody callCreateBody);

  @POST(SjApiPaths.rechargeCreateUrl)
  Future<SjResponseData> rechargeCreate(
      @Body() SjRechargeCreateBody rechargeCreateBody);

  @POST(SjApiPaths.rechargePaymentUrl)
  Future<SjResponseData> rechargePayment(
      @Body() SjRechargePaymentBody rechargePaymentBody);

  @POST(SjApiPaths.reviewModeConsumeUrl)
  Future<SjResponseData> reviewModeConsume(
      @Body() SjReviewConsumeBody reviewConsumeBody);

  @POST(SjApiPaths.globalLogout)
  Future<SjResponseData> globalLogout();

  @POST(SjApiPaths.deleteAccount)
  Future<SjResponseData> deleteAccount();

  @POST(SjApiPaths.mediaSearchUrl)
  Future<SjResponseData> mediaSearchUrl(@Body() List<SjMediaSearchItemData> requestBody);
}
